<?php
session_start();
$mysqli = new mysqli('localhost:3306','root','','boke');
// $mysqli = new mysqli('localhost:3306','liuboyto_root','#MySQLmima#618','liuboyto_618');

mysqli_query($mysqli,"set names utf8");
 $id = $_POST['id'];
 $password = $_POST['password'];
 echo $name;
 // echo $password;
 $sql = "select password from user where id='$id'";
 $res = $mysqli->query($sql);
while($row=$res->fetch_assoc()){
	$mysqlpassword = $row["password"];
	
}
 if($mysqlpassword==$password){
 	echo "登陆成功,请添加数据" ;	
	 	if($id==1){
		$_SESSION['userid']=1;
		header("location:guanliyuan.html") ;
	}else{
		$_SESSION['userid']=$id;
		header("location:index.html"); 
	};
 }else{
 	echo "用户名或密码错误";
 }

$mysqli->close();

 ?>